function check() {
    var name = document.getElementById("name").value;
    var pass = document.getElementById("pass").value;

    if (name == "abc" && pass == "123" || name == "admin2" && pass == "456789") {
        alert("登录成功！");
        window.location.href = "index.html";
        return false; // 阻止表单提交
    } else {
        alert("用户名或密码错误！");
        return false; // 阻止表单提交
    }
}